package eerbaar.persona;

import eerbaar.body.IHead;
import eerbaar.elements.extension.ExtentionInstaller;
import eerbaar.elements.extension.IPoints;
import eerbaar.position.IPosition;

public class PersonaFactory {

    public static IPersona create(String name, int x, int y) {
        Persona result = new Persona(name, x, y);

        ExtentionInstaller.install(result);

        return result;
    }

    public static IPersona create(String name, IPosition position, IHead head,
            int points, String program) {

        Persona result = new Persona(name, position, head);

        ExtentionInstaller.install(result);
        IPoints impl = result.getExtension(IPoints.class);
        if (impl != null) {
            impl.setPoints(points);
        }
        result.setProgram(program);

        return result;
    }

    private PersonaFactory() {
        //
    }

}
